@extends('front.common.layout')

@section('title',$data['seo']['config_title'])
@section('keywords',$data['seo']['config_keywords'])
@section('description',$data['seo']['config_description'])

@section('content')
    <!-- banner -->
    <div class="inner-banner has-base-color-overlay text-center"
         style="background: url({{ asset('/front/images/background/news-banner.jpg') }});">
        <div class="container">
            <div class="box">
                <h3>NEWS</h3>
            </div>
        </div>
    </div>
    <div class="breadcumb-wrapper">
        <div class="container">
            <div class="breadcrumb_bar">
                <div class="breadcrumb_menu">
                    <ul class="link-list">
                        <li>
                            <a href="{{ url('/') }}">Home</a>
                        </li>
                        <li>
                            NEWS
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- banner end -->
    <div class="sidebar-page-container">
        <div class="container">
            <div class="row">
                <div class="col-lg-9 col-md-9 col-sm-12 m-order-2">
                    <section class="news-section padd-2">
                        <div class="row">
                            @foreach($data['news_list'] as $v)
                                <div class="col-md-12 col-sm-12 col-xs-12">
                                    <div class="news-style-one">
                                        <div class="inner-box row">
                                            <div class="image col-md-3 row">
                                                <a href="{{ url('news-detail',$v->id) }}" class="col align-self-center">
                                                    <img src="{{ asset($v->img) }}" alt="{{ asset($v->img) }}"/>
                                                </a>

                                            </div>
                                            <div class="lower-content col-md-9">
                                                <h3><a href="{{ url('news-detail',$v->id) }}">{{ $v->news_title }}</a></h3>
                                                <div class="text">
                                                    <a href="{{ url('news-detail',$v->id) }}">{{ $v->abstract }}</a>
                                                </div>
                                                <div class="post-time">{{ date('d M, Y',strtotime($v->created_at)) }}</div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>
                        <br>
                        {{ $data['news_list']->links('front.common.paginate') }}
                    </section>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-12 m-order-1">
                    <div class="blog-sidebar padd-4">
                        <div class="category-style-one sidebar-padd mar-1">
                            <div class="inner-title">
                                <h3>News Type</h3>
                            </div>
                            <ul class="list">
                                @foreach($data['news_type'] as $v)
                                    <li>
                                        <a href="{{ url('news-type',$v->id) }}" class="clearfix">
                                            <span class="float_left">{{ $v->name }}</span>
                                            <span class="float_right"></span>
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>

                        <div class="popular_news sidebar-padd mar-1">
                            <div class="inner-title">
                                <h3>latest news</h3>
                            </div>
                            <div class="popular-post">
                                @foreach($data['latest_news'] as $v)
                                    <div class="item">
                                        <h4><a href="{{ url('news-detail',$v->id) }}">{{ $v->news_title }}</a></h4>
                                        <div class="post-info">{{ date('M d, Y',strtotime($v->created_at)) }}</div>
                                    </div>
                                @endforeach
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
@endsection

